package qc.module.cms.api.controller;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * WebSocketConfig
 *
 * @author QuCheng Tech
 * @since 2025/2/18
 */
@Configuration
//@ConditionalOnWebApplication//使用内置tomcat时需要该注解，使用外置tomcat时需要注释；实测使用内置tomcat不需要该注解
@EnableWebSocket
public class WebSocketConfig {
    //定义标识消息主题
    /**
     * 消息主题-测试数据
     */
    public final static String Topic_Test = "test";
    /**
     * 消息主题-大屏显示配置数据
     */
    public final static String Topic_Cms_LedDisplay_Config = "leddisplay";

    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
}

